<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			function Humans(name){
				this.name=name;
				this.clothing=["trousers","dress","jacket"];
			}
			Humans.prototype.sayName=function(){
				alert(this.name);
			}
			function Man(name,age){
				Humans.call(this,name);
				this.age=age;
			}
			Man.prototype=new Humans();//继承方法
			Man.prototype.sayAge=function(){
				alert(this.age);
			}
			var man1=new Man("marry",30);
			man1.clothing.push("coat");
			alert(man1.clothing);
			man1.sayName();
			man1.sayAge();
			
			var man2=new Man("Tom",50);
			alert(man2.clothing);
			man2.sayName();
			man2.sayAge();
		</script>
	</body>
</html>
